import React, { Component } from 'react'

export default class Footer extends Component {
  render() {
    const { doneCount, todoTotal, checked, change } = this.props
    // console.log(this.props)
    return (
      <div>
        <div className="checkbox">
          <label>
            <input
              type="checkbox"
              checked={checked}
              onChange={(e) => change(e.target.checked)}
            />
            已完成{doneCount}/全部{todoTotal}
          </label>
          {/* <span> 已完成1/全部3</span> */}

          <button
            onClick={this.props.clearAllDone}
            type="button"
            className="btn btn-danger pull-right"
          >
            清除已完成任务
          </button>
        </div>
      </div>
    )
  }
}
